home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / New System Software Extensions / PlainTalk™ Speech Technologies / Text To Speech / Programming Stuff / Examples / WannaSpeech / Window.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-15  |  21.2 KB  |  628 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        Window.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1990-1993 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11. /* You may incorporate this sample code into your applications without
  12. ** restriction, though the sample code has been provided "AS IS" and the
  13. ** responsibility for its operation is 100% yours.  However, what you are
  14. ** not permitted to do is to redistribute the source as "DSC Sample Code"
  15. ** after having made changes. If you're going to re-distribute the source,
  16. ** we require that you make it clear in the source that the code was
  17. ** descended from Apple Sample Code, but that you've made changes. */
  18.  
  19. /* This file contains the code for the document procedure pointers for the main Wannabe
  20. ** document.  Wannabe currently only supports one type of documents, type 'DUMD',
  21. ** which stands for "DUMb Document". */
  22.  
  23. /* For more information on this file, please read the read.me file "=How to write your app". */ 
  24.  
  25. /**************************************************************************************
  26. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
  27.  
  28. Changes have been made to the pristine purity of this code I have added the lines
  29. necessary to change it from AppWannaBe to WannaSpeech, the Text to Speech sample
  30. from AppleSoft Developer Technical Support
  31.  
  32.    Written by:    Guillermo A. Ortiz        AppleSoft Developer Technical Support
  33.    Date:        08/04/93
  34.  
  35. Please read WannaSpeech.readme for the gruesome details.
  36. **************************************************************************************/
  37.  
  38.  
  39. /*****************************************************************************/
  40.  
  41.  
  42.  
  43. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  44. #include "App.defs.h"        /* Get various application definitions.            */
  45. #include "App.protos.h"        /* Get the prototypes for application.            */
  46.  
  47. #ifndef __ERRORS__
  48. #include <Errors.h>
  49. #endif
  50.  
  51. #ifndef __FONTS__
  52. #include <Fonts.h>
  53. #endif
  54.  
  55. #ifndef __RESOURCES__
  56. #include <Resources.h>
  57. #endif
  58.  
  59. #ifndef __TOOLUTILS__
  60. #include <ToolUtils.h>
  61. #endif
  62.  
  63. #ifndef __UTILITIES__
  64. #include "Utilities.h"
  65. #endif
  66.  
  67. #include "WannaSpeech.h"    /* Get speech stuff trying to minimize files changed */
  68.  
  69.  
  70. /*****************************************************************************/
  71.  
  72.  
  73.  
  74. Boolean        gNoDefaultDocument = false;
  75.                     /* Set to true if app should boot with no default document. */
  76.                     /* This tells DTS.Lib..framework what you want. */
  77.  
  78. OSType        gAppWindowType = kDocFileType;    /* Main document type. */
  79. long        gAppWindowAttr = kwAppWindow;    /* Main window attributes. */
  80.  
  81. short        gMinVersion    = kMinVersion;    /* Minimum document version app can support. */
  82. short        gMaxVersion    = kMaxVersion;    /* Maximum document version app can support. */
  83.                                             /* More informing DTS.Lib..framework. */
  84.  
  85. extern short        gPrintPage;                /* Non-zero means we are printing. */
  86.                                             /* DTS.Lib..framework global. */
  87.  
  88. extern RgnHandle    gCursorRgn;                /* We handle cursors here, so we need */
  89. extern CursPtr        gCursorPtr;                /* to know about these things. */
  90.                                             /* Above are DTS.Lib..framework globals. */
  91.  
  92. /* Currently Wannabe doesn't ever change the cursor, so we don't actually need
  93. ** these referenced here.  However, since Wannabe is supposed to be an application
  94. ** in progress, it is very likely that you will need to reference these as your
  95. ** project develops.  See DTS.StyleChat and DTS.Draw for examples of setting the cursor. */
  96.  
  97. /* Some cursors are pointer-based, and some cursors are resource-based.
  98. ** If a cursor is resource-based, it needs to be loaded and made to not move,
  99. ** and then gCursorPtr can be set to point to it.  This makes all cursors
  100. ** pointer-based.  Also, gCursorPtr is used by DTS.Lib..framework to
  101. ** determine if there is a current cursor.  If gCursorPtr is nil, then
  102. ** there is no current cursor, and the cursor has to be recalculated, no
  103. ** matter where the mouse is.  If gCursorPtr is not nil, then if the
  104. ** mouse position is within the cursor region gCursorRgn, the cursor is
  105. ** correct, and no recalculation is necessary.  If it is outside this region,
  106. ** then it is recalculated.  What does this all mean?  It means that if you
  107. ** want to guarantee that the cursor is recalculated next time DoWindowCursor()
  108. ** is called, set gCursorPtr to nil.
  109. **
  110. ** If you have a cursor resource, you need to:
  111. ** 1) Load the resource.
  112. ** 2) Make a fixed copy of it.
  113. ** 3) Set the cursor to it.
  114. ** 4) Set gCursorPtr to point to the fixed copy.
  115. **
  116. ** There is a function that does almost all of this, called DoSetResCursor().
  117. ** It does all but set gCursorPtr to it.  (It actually sets gCursorPtr to nil.)
  118. ** It does return a pointer to the permanent copy, so typically what you will
  119. ** want to do is the following:
  120. **     gCursorPtr = DoSetResCursor(theCursorID);
  121. **
  122. ** So why set gCursorPtr to nil as the default action?  This allows you to
  123. ** set a temporary cursor, which will be replaced when DoWindowCursor() is
  124. ** called next, or it allows you to set a cursor that maps to the cursor
  125. ** region gCursorRgn (by setting gCursorPtr to the return result). */
  126.  
  127.  
  128.  
  129. /*****************************************************************************/
  130. /*****************************************************************************/
  131.  
  132.  
  133.  
  134. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  135.  
  136. /* Calculate application specific frame area (Called by DoCalcFrameRgn).
  137. ** You are passed an empty region.  You are supposed to add any custom frame
  138. ** parts that this document uses.  Typically there are no frame portions, as
  139. ** they are accounted for in other ways.  The scrollbars and grow icon will
  140. ** automatically be contributed to the calculation of the frame region.
  141. ** If you use sidebars, these are also added in automatically.  This is only
  142. ** used if the frame region is more complicated than can automatically be
  143. ** handled.  So, almost always, you will simply leave the region empty. */
  144.  
  145. #pragma segment TheDoc
  146. void    CalcFrameRgn(FileRecHndl frHndl, WindowPtr window, RgnHandle rgn)
  147. {
  148. #pragma unused (frHndl, window, rgn)
  149. }
  150.  
  151.  
  152.  
  153. /*****************************************************************************/
  154.  
  155.  
  156.  
  157. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  158.  
  159. /* This is called (by DoContentClick()) when a mouse-down event occurs in the content of
  160. ** a window.  Other applications might want to call FindControl, TEClick, etc., to
  161. ** further process the click. */
  162.  
  163. #pragma segment TheDoc
  164. void    ContentClick(WindowPtr window, EventRecord *event, Boolean firstClick)
  165. {
  166. #pragma unused (firstClick)
  167.  
  168.     ControlHandle    ctl;
  169.     short            action, cnum;
  170.  
  171.     cnum = IsCtlEvent(window, event, &ctl, &action);
  172.         /* That was easy.  Scrolling was just handled.  Other stuff would be handled
  173.         ** by IsCtlEvent, if we had other stuff to do.  We don't have any other
  174.         ** controls in the content besides the document scrollbars. */
  175.  
  176.     return;
  177. }
  178.  
  179.  
  180.  
  181. /*****************************************************************************/
  182.  
  183.  
  184.  
  185. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  186.  
  187. /* DoKeyDown() is first called by the application.  Then if the key isn't a menu
  188. ** key, DoKeyDown() calls this code.  Here are the rules for this function:
  189. **
  190. ** 1) If you handle the key, return(true).  This completes the key handling.
  191. ** 2) If you don't handle the key, you return false.  However, there are two
  192. **    situations for not handling the key:
  193. **      a) You want someone else to.
  194. **      b) You want nobody else to look at the key.
  195. **    This is what the boolean passThrough is for.  If you wish the next window
  196. **    to have a look at the key, set the boolean passThrough to true.  passThrough
  197. **    is already initialized to false, which is the common case, so you only have
  198. **    to worry about setting it true.
  199. **
  200. ** If you have a window that never processes keys and always passes them through,
  201. ** just set the contentKeyProc to nil.  This will indicate to the application
  202. ** framework that all keys should be passed through this window.  DTS.Draw has
  203. ** such a window.  Its palette window doesn't accept keys.  They are passed through
  204. ** to document windows. */
  205.  
  206. #pragma segment TheDoc
  207. Boolean    ContentKey(WindowPtr window, EventRecord *event, Boolean *passThrough)
  208. {
  209. #pragma unused (passThrough)
  210.  
  211.     short    cnum;
  212.  
  213.     cnum = IsCtlEvent(window, event, nil, nil);
  214.         /* See DTS.Draw for an example of what you might do here. */
  215.  
  216.     return(true);
  217. }
  218.  
  219.  
  220.  
  221. /*****************************************************************************/
  222.  
  223.  
  224.  
  225. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  226.  
  227. /* Draw application specific content (Called by DoDrawFrame).
  228. **
  229. ** If your application has any custom frame areas, or if it uses sidebars,
  230. ** this is the function that you would put the frame drawing code.  The
  231. ** document scrollbars and grow icon drawing is handled by DTS.framework.
  232. ** Just do the sidebar and custom areas here. */
  233.  
  234. #pragma segment TheDoc
  235. void    DrawFrame(FileRecHndl frHndl, WindowPtr window, Boolean activate)
  236. {
  237.     MoveTo(0, (*frHndl)->fileState.topSidebar - 1);
  238.     LineTo((*frHndl)->fileState.leftSidebar - 1 - 16384, (*frHndl)->fileState.topSidebar - 1);
  239.     LineTo((*frHndl)->fileState.leftSidebar - 1 - 16384, 16383);
  240.  
  241.     BeginFrame(window);
  242.     DoDrawControls(window, activate);
  243.     EndFrame(window);
  244. }
  245.  
  246.  
  247.  
  248. /*****************************************************************************/
  249.  
  250.  
  251.  
  252. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  253.  
  254. /* Frees up any application-specific memory in the document.  This is called by
  255. ** DoFreeDocument, which is called by DisposeDocument().  The application would
  256. ** call DisposeDocument(), not DoFreeDocument() or FreeDocument() directly.
  257. **
  258. ** The document may have a bunch of handles off the main handle of the document.
  259. ** This is where they are freed.  DisposeDocument calls this prior to releasing
  260. ** the ram for the main handle of the document, so release everything else
  261. ** here, or you will have a memory leak.
  262. **
  263. ** NOTE:  Calling DefaultFreeDocument() frees up all memory used by a
  264. ** hierarchical document (see TreeObj package). */
  265.  
  266. #pragma segment TheDoc
  267. OSErr    FreeDocument(FileRecHndl frHndl)
  268. {
  269.     return(DefaultFreeDocument(frHndl));
  270. }
  271.  
  272.  
  273.  
  274. /*****************************************************************************/
  275.  
  276.  
  277.  
  278. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  279.  
  280. /* Any additional window disposal tasks can be handled here. */
  281.  
  282. #pragma segment TheDoc
  283. OSErr    FreeWindow(FileRecHndl frHndl, WindowPtr window)
  284. {
  285. #pragma unused (window)
  286.  
  287.     WindowPtr    ww;
  288.     FileRecHndl    ff;
  289.  
  290.     if ((*frHndl)->fileState.sfType == kDocFileType) {
  291.         for (ww = nil; ww = GetNextWindow(ww, 0);) {
  292.             ff = (FileRecHndl)GetWRefCon(ww);
  293.             if ((*ff)->fileState.sfType == kViewHierFileType) {
  294.                 if ((*frHndl)->d.doc.root == (*ff)->d.doc.root) {
  295.                     DisposeOneWindow(ww, kClose);
  296.                     ww = nil;
  297.                 }
  298.             }
  299.         }
  300.     }
  301.  
  302.     return(noErr);
  303. }
  304.  
  305.  
  306.  
  307. /*****************************************************************************/
  308.  
  309.  
  310.  
  311. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  312.  
  313. /* Image the document into the current port.
  314. **
  315. ** The only thing tricky about this function is that it needs to key off of
  316. ** the global variable gPrintPage.  gPrintPage is the current page that is
  317. ** being printed.  If gPrintPage is 0, then you are drawing to the window.
  318. **
  319. ** For when printing:
  320. **
  321. ** If gPrintPage is non-0, that is the page to be printed.  If after imaging
  322. ** the page there are no more pages, you should set gPrintPage to 0.  This
  323. ** indicates to the print loop that the end of the document has been reached.
  324. ** Even if the user indicated in the job dialog to print more pages, setting
  325. ** gPrintPage to 0 states that the last page has been printed.  This is necessary
  326. ** because the print loop can't know when printing is done.  The imaging procedure
  327. ** is the logical one to state when everything has been imaged. */
  328.  
  329. #pragma segment TheDoc
  330. OSErr    ImageDocument(FileRecHndl frHndl)
  331. {
  332. #pragma unused (frHndl)
  333.  
  334.     WindowPtr    curPort;
  335.  
  336.     GetPort(&curPort);
  337.     if (!gPrintPage) {                                    /* If not printing... */
  338.         DoDrawControls(curPort, false);                    /* Draw the content controls. */
  339.     }
  340.     gPrintPage = 0;
  341.  
  342.     return(noErr);
  343. }
  344.  
  345.  
  346.  
  347. /*****************************************************************************/
  348.  
  349.  
  350.  
  351. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  352.  
  353. /* This function does the remaining window initialization.
  354. **
  355. ** There may be additional content initialization for the window.  At this point,
  356. ** you have a window, but it is currently invisible.  If you return noErr, then
  357. ** the window will be set to the state indicated for that window.  Why this function?
  358. ** You may wish to add controls to the content of the window.  You may have a
  359. ** TextEdit record in the content.  All of these sort of things can't be created
  360. ** until there is a window to contain them.  First a document is read in, and then
  361. ** if the document creation succeeds, a window is created for that document.
  362. ** At this point we have a document, and we are on our way to having a window.
  363. ** All that remains is any additional content initialization.  Do it, return
  364. ** noErr, and everybody's happy.  If something goes wrong here, return the error,
  365. ** and the incomplete window will be disposed of. */
  366.  
  367. #pragma segment TheDoc
  368. OSErr    InitContent(FileRecHndl frHndl, WindowPtr window)
  369. {
  370.     OSErr    err;
  371.  
  372.     err = AddControlSet(window, (*frHndl)->fileState.sfType, kwStandardVis, 0, 0, nil);
  373.     
  374.     /*     We call the routine that changes the string for the voice name according to 
  375.         the SpeechParams record associated with the document.
  376.     */
  377.     SetTECtlText(window, frHndl, kVoiceName, (*frHndl)->d.doc.docSpeech.curVoice.name);
  378.  
  379.     return(err);
  380. }
  381.  
  382.  
  383.  
  384. /*****************************************************************************/
  385.  
  386.  
  387.  
  388. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  389.  
  390. /* The code below assumes that you are using the hierarchical document package.
  391. ** If you are, the entire hierarchical document is read in with just these two
  392. ** calls.  If you don't use it, you are on your own.  See DTS.StyleChat for an
  393. ** example of an application that uses the DTS.framework without the hierarchical
  394. ** document package. */
  395.  
  396. #pragma segment TheDoc
  397. OSErr    ReadDocument(FileRecHndl frHndl)
  398. {
  399.     OSErr    err;
  400.  
  401.     err = DefaultReadDocument(frHndl);
  402.     if (!err)
  403.         DefaultReadDocumentFixup(frHndl);
  404.  
  405.     return(err);
  406. }
  407.  
  408.  
  409.  
  410. /*****************************************************************************/
  411.  
  412.  
  413.  
  414. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  415.  
  416. /* Resize application specific content (Called by ResizeWindow).
  417. **
  418. ** This gets called when a user does a zoom or window resizing operation.
  419. ** It is possible that things in the content need to be resized in conjunction
  420. ** with the resizing of the window. */
  421.  
  422. #pragma segment TheDoc
  423. void    ResizeContent(WindowPtr window, short oldh, short oldv)
  424. {
  425. #pragma unused (window, oldh, oldv)
  426.  
  427.     /* See DTS.StyleChat for a sample usage of this function. */
  428. }
  429.  
  430.  
  431.  
  432. /*****************************************************************************/
  433.  
  434.  
  435.  
  436. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  437.  
  438. /* Scroll application specific frame (Called by DoScrollFrame).
  439. **
  440. ** Some applications may need to scroll the "frame" of the document along
  441. ** with the document contents.  This is common for applications with rulers,
  442. ** or other similar sidebar items. */
  443.  
  444. #pragma segment TheDoc
  445. void    ScrollFrame(FileRecHndl frHndl, WindowPtr window, long dh, long dv)
  446. {
  447. #pragma unused (frHndl, window, dh, dv)
  448. }
  449.  
  450.  
  451.  
  452. /*****************************************************************************/
  453.  
  454.  
  455.  
  456. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  457.  
  458. /* Since the hierarchical document package isn't used by DTS.StyleChat,
  459. ** this function actually never gets called. */
  460.  
  461. #pragma segment TheDoc
  462. void    UndoFixup(FileRecHndl frHndl, Point contOrg, Boolean afterUndo)
  463. {
  464. #pragma unused (frHndl, contOrg, afterUndo)
  465.  
  466.     /* See DTS.Draw for an example of what you might do here. */
  467. }
  468.  
  469.  
  470.  
  471. /*****************************************************************************/
  472.  
  473.  
  474.  
  475. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  476.  
  477. /* This function is where you adjust the cursor to reflect the location in the
  478. ** document or window.  You have the additional input of gCursorRgn to deal
  479. ** with.  The way that the cursor handling works is as follows:
  480. ** 1) The application calls DoWindowCursor().
  481. ** 2) DoWindowCursor() works its way through the windows/documents, front to back.
  482. **    It looks at the document's windowCursorProc and checks to see if the document
  483. **    has one.  If the document doesn't have one, then it assumes that that window
  484. **    always wants an arrow.  If the cursor is over that window, the cursor is set
  485. **    to an arrow, and we're done.  If the cursor isn't over the window, then the next
  486. **    window is tried.  If all documents don't have a windowCursorProc, then the cursor
  487. **    is set to an arrow (for the non-document area of the screen).
  488. ** 3) If a document has a windowCursorProc, then the proc is called.  The proc's
  489. **    job is as follows:
  490. **    a) If the cursor is over a position that is determined by the window, then
  491. **       the proc removes other areas from gCursorRgn.  Note that it should not
  492. **       simply set the area to what it "thinks" is the correct area.  This window
  493. **       may not be the front-most.  Other windows will have already been subtracted
  494. **       from gCursorRgn.  The resultant gCursorRgn is the correct cursor area,
  495. **       and should be passed to WaitNextEvent calls in the application (already the case
  496. **       in EventLoop.c).  Also, the cursor should be set to the correct cursor, of course.
  497. **       You should also return true, as the cursor has been determined.
  498. **    b) If the cursor is not over a position for this window, then you should
  499. **       return.  You will either pass back true or false.  If you don't wish
  500. **       windows behind this window to have a shot at cursor determination, then
  501. **       return true.  This states that the cursor is "determined".  It is, in the
  502. **       sense that no further determination will occur.  If you return false, then
  503. **       other windows get a shot at determining the cursor.
  504. **
  505. ** Setting the cursor to the correct cursor isn't as easy as you would expect.
  506. ** DTS.Lib..framework uses the global gCursorPtr as the reference to the cursor.  This is
  507. ** fine if the cursor is pointer-based, but if the cursor is resource-based, it is a bit
  508. ** more of a problem.  What you will need to do is to call DoSetResCursor() to make the
  509. ** resource cursor pointer-based.  DoSetResCursor() will set gCursorPtr to nil, and it
  510. ** also returns the pointer to the permanent copy of the cursor resource.  Just set gCursorPtr
  511. ** to the return result of DoSetResCursor(), and you will be set. */
  512.  
  513. #pragma segment TheDoc
  514. Boolean    WindowCursor(FileRecHndl frHndl, WindowPtr window, Point globalPt)
  515. {
  516. #pragma unused (frHndl, window, globalPt)
  517.  
  518.     /* For examples of applications that have non-arrow cursor regions,
  519.     ** see DTS.StyleChat and DTS.Draw. */
  520.  
  521.     DoSetCursor(&qd.arrow);
  522.     return(true);
  523. }
  524.  
  525.  
  526.  
  527. /*****************************************************************************/
  528.  
  529.  
  530.  
  531. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  532.  
  533. /* After the DTS.Lib framework disposes of a window, it calls here.  This is
  534. ** to give the application a chance to do any additional tasks related to
  535. ** a window closing.  DTS.StyleChat doesn't have anything else extra to do. */
  536.  
  537. #pragma segment TheDoc
  538. void    WindowGoneFixup(WindowPtr window)
  539. {
  540. #pragma unused (window)
  541. }
  542.  
  543.  
  544.  
  545. /*****************************************************************************/
  546.  
  547.  
  548.  
  549. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  550.  
  551. /* The reverse function of ReadDocument. */
  552.  
  553. #pragma segment TheDoc
  554. OSErr    WriteDocument(FileRecHndl frHndl)
  555. {
  556.     return(DefaultWriteDocument(frHndl));
  557. }
  558.  
  559.  
  560.  
  561. /*****************************************************************************/
  562.  
  563.  
  564.  
  565. /* •• You don't call this.  DTS.Lib..framework does at open-application time. •• */
  566.  
  567. #pragma segment TheDoc
  568. OSErr    DoOpenApplication(void)
  569. {
  570.     return(noErr);
  571. }
  572.  
  573.  
  574.  
  575. /*****************************************************************************/
  576. /*****************************************************************************/
  577. /*****************************************************************************/
  578.  
  579.  
  580.  
  581. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  582.  
  583. #pragma segment TheDoc
  584. Boolean    AdjustMenuItems(WindowPtr window, short menuID)
  585. {
  586.     Boolean        redrawMenuBar;
  587.     MenuHandle    menu;
  588.  
  589.     redrawMenuBar = false;
  590.  
  591.     switch (menuID) {
  592.         case mFile:
  593.             redrawMenuBar = DoAdjustFileMenu(window);
  594.             break;
  595.         case mEdit:
  596.             redrawMenuBar = DoAdjustEditMenu(window);
  597.             break;
  598.         case mSpeech:
  599.             redrawMenuBar = DoAdjustSpeechMenu(window);
  600.             break;
  601.         default:
  602.             if (menu = GetMHandle(menuID))
  603.                 (*menu)->enableFlags |= 0xFFFFFFFEL;
  604.             break;
  605.     }
  606.  
  607.     return(redrawMenuBar);
  608. }
  609.  
  610.  
  611.  
  612. /*****************************************************************************/
  613.  
  614.  
  615.  
  616. /* •• You don't call this.  DTS.Lib..framework does for appropriate document type(s). •• */
  617.  
  618. #pragma segment TheDoc
  619. Boolean    DoMenuItem(WindowPtr window, short menuID, short menuItem)
  620. {
  621. #pragma unused (window)
  622.  
  623.     return(DoMenuCommand(menuID, menuItem));
  624. }
  625.  
  626.  
  627.  
  628.